Analysis

Looking for insights into the Vaccination Uptake by detailed analysis of Ministry of Health Covid 19 Vaccination data

We will explore the rate of change of the unvaccinated by Age, Sex and Ethnicity

Plots of current vaccination ratios

from IPython.core.display import display, HTML
from plotly.offline import init_notebook_mode, plot
init_notebook_mode(connected=True)

import modules
import modules.data_prep as dp
import modules.data_viz1 as dv

data = dp.MOH_data()
data.prep_step1_pull_data()
data.prep_step_2_read_all_uptake_data()
data.prep_step_3_generate_report_data()

plot(dv.plot2(data.df_all_weeks_no_gender_age_category), filename = 'figure2.html')
display(HTML('figure2.html'))
Repo at ../data_moh_nz successfully loaded.

The last data commited by the MHO is : '2021-11-02 17:05:20+13:00 be576e9d LOI 4pm 02.11.21'

The eligible population is : 161223

Current week is :'21W43'

plot(dv.plot3(data.df_all_weeks_no_gender_age_category), filename = 'figure3.html')
display(HTML('figure3.html'))
df = data.df_all_weeks_no_gender_age_category.query((
    '["European or Other", "Maori"] in `Ethnic group`'
    # ' and `Age Category` == "12-19"'
    # ' and ["12-19","20-39"] in `Age Category`'
    )
).sort_values(["Age Category", "Ethnic group"])


plot(dv.plot_overall_vaccination_status(df),filename = 'figure4.html')
display(HTML('figure4.html'))

The following pltos indicate the amount of first doses received each week. The 2 main large populations are looked at: Maori and European

# import plotly.io as pio
import plotly.express as px
# import plotly.offline as py
ethnic_group="Maori, European or Other"
fig = px.bar(data.df_all_weeks_no_gender.query(f'{ethnic_group.split(", ")} in `Ethnic group`'), 
    x="Week ending", 
    y="First dose administered Changed", 
    title=f"{ethnic_group} -  First dose received",
    facet_col="Ethnic group", 
    # facet_col="Gender",
    color='Age Category',
    text='First dose administered Changed',
    hover_data=[
        "Ethnic group",
        "Age Category",
        "Population unvaccinated at week start",
        "Population unvaccinated at week end",
        "Population",
        "First dose administered_prior",
        "First dose administered Changed",
        "First dose administered Changed as Percent of unvaccinated Population",
    ],)
plot(fig,filename = 'figure5.html')
display(HTML('figure5.html'))
ethnic_group="European or Other"
fig = px.bar(data.df_all_weeks_no_gender.loc[data.df_all_weeks_no_gender['Ethnic group']==ethnic_group], 
    x="Week ending", 
    y="First dose administered Changed", 
    title=f"{ethnic_group} -  First dose received",
    color='Age Category',
    # facet_col="Gender",
    hover_data=[
        "Ethnic group",
        "Age Category",
        "Population unvaccinated at week start",
        "Population unvaccinated at week end",
        "Population",
        "First dose administered_prior",
        "First dose administered Changed",
        "First dose administered Changed as Percent of unvaccinated Population",
    ],)
plot(fig,filename = 'figure6.html')
display(HTML('figure6.html'))
ethnic_group="Maori"
fig = px.bar(data.df_all_weeks_no_gender.loc[data.df_all_weeks_no_gender['Ethnic group']==ethnic_group], 
    x="Week ending", 
    y="First dose administered Changed", 
    title=f"{ethnic_group} -  First dose received",
    color='Age Category',
    # facet_col="Gender",
    hover_data=[
        "Ethnic group",
        "Age Category",
        "Population unvaccinated at week start",
        "Population unvaccinated at week end",
        "Population",
        "First dose administered_prior",
        "First dose administered Changed",
        "First dose administered Changed as Percent of unvaccinated Population",
    ],)
plot(fig,filename = 'figure7.html')
display(HTML('figure7.html'))

References

Data source: Ministry of Health, New Zealand COVID-19 Data - https://github.com/minhealthnz/nz-covid-data